-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve console output to show packet enum names (magic_enum) #1344
feat: Improve console output to show packet enum names (magic_enum) #1344
Conversation
Space macros out utilize cache locality ensure no lost functionality
This reverts commit 33fa5f8.
change function handle formatting and function definition tweaks
Marking as draft because I had an epiphany about how to make the performance of our magic_enum implementation equal or exceed that of the preprocessor implementation. I will test this later, but here's the idea: Instead of directly using the enum_name() function magic_enums provides, I will create a wrapper function called "StringifiedEnum" that defines a static const std::array provided by magic_enum's similarly-named enum_names() function. This function will then pass a reference to the corresponding array entry to the calling function. So, this should load a single copy of the pre-sorted(?) std::array into memory at compile-time, and it will be templated-out so those arrays are only generated for the enums this function is called on. This should essentially eliminate any and all performance overhead magic_enums could possibly impose, as after compilation only an array of entries corresponding to the enum would exist, and a function to access it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments that should be talked about; also is there anything more to adding a submodule others need to be aware of when updating dlu or is the README already taking care of this?
That's it for me. Ready to merge this when you all are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some odd spacing on the edited else but im not going to block on it. Would recommend if you don't already alt+shift+f to format a file to the repo standard if it currently doesn't meet it (for vscode on windows at least this hotkey works)
Replaces #1340. Adds magic_enum as a dependency in order to enable enum reflection and display world and packet message enum strings in the server output.